import 'package:flutter/material.dart';

class InkWellExample extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Center(
      child: _ink()
    );
  }

  Widget _inkWell(){
    return InkWell(
        onTap: (){},
        splashColor: Colors.red,
        child: Container(
          padding: EdgeInsets.all(15),
          child: Text("InkWell点击效果"),
        )
    );
  }

  Widget _ink(){
    return Ink(
      decoration: BoxDecoration(
          gradient: LinearGradient(
              begin: Alignment.topLeft,
              end: Alignment.bottomRight,
              colors: [Colors.lightBlueAccent,Colors.lightBlueAccent]
          ),
          borderRadius: BorderRadius.all(Radius.circular(20))),
      child: InkWell(
        borderRadius: BorderRadius.all(Radius.circular(20)),
        child: Container(
          padding: EdgeInsets.symmetric(vertical: 8, horizontal: 20),
          child: Text(
            '配合Ink的点击效果',
            style: TextStyle(color: Colors.white),
          ),
        ),
        onTap: () {},
      ),
    );
  }
}
